package com.yuanlrc.base.dao.admin;

import com.yuanlrc.base.entity.admin.Faculties;
import com.yuanlrc.base.entity.admin.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;


/**
 * 学院列表数据处理层
 *
 */
@Repository
public interface FacultiesDao extends JpaRepository<Faculties,Long> {

    /**
     * 根据学院id查询
     * @param id
     * @return
     */
    @Query("select f from Faculties f where id = :id")
    public Faculties find(@Param("id")Long id);



    /**
     * 按照学院编号查找
     * @param num
     * @return
     */
    public Faculties findByNum(String num);

    /**
     * 按照学院名查找
     * @param name
     * @return
     */
    public Faculties findByName(String name);

}
